from datetime import datetime

# 初始化 SQL 语句
sql = "INSERT INTO tb_user (id, open_id, nickname, avatar, status, create_time) VALUES "

# 动态生成插入值
values_sql = []
for i in range(2, 21):
    create_time = datetime.now().strftime('%Y-%m-%d')  # 获取当前时间，包含时分秒
    values_sql.append(
        f"({i}, 'open_id_{i}', '测试用户{i}', NULL, 0, '{create_time}')"
    )

# 拼接完整的 SQL
sql += ", ".join(values_sql)

# 打印生成的 SQL
print(sql)